package com.hzyl.famousreader.view.adapter;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzyl.famousreader.R;
import com.hzyl.famousreader.ThemeColor;

import java.util.List;

/**
 * 主题
 */
public class ThemeAdapter extends BaseQuickAdapter<ThemeColor, BaseViewHolder> {

  public ThemeAdapter(@Nullable List<ThemeColor> data) {
    super(R.layout.item_theme, data);
  }

  @Override
  protected void convert(BaseViewHolder helper, ThemeColor item) {
    helper.setBackgroundColor(R.id.theme_iv_color, item.getColor());
    helper.setText(R.id.theme_tv_name, item.getLabel());
    helper.setTextColor(R.id.theme_tv_name, item.getColor());
  }
}
